package droid.mapViewer.primitives;

import java.nio.FloatBuffer;
import java.util.List;

import javax.microedition.khronos.opengles.GL10;

import droid.mapViewer.graphDrawers.Pen;
import droid.mapViewer.utils.Point;
import droid.mapViewer.utils.PointsFloatBuffer;

public class PLine implements IPrimitive {
	private PointsFloatBuffer pLine;  
	private Pen pen;
	
	public PLine(List<Point> points, Pen pen) {
		pLine = PointsFloatBuffer.convertToFloatBuffer(points, null);
		this.pen=pen;
	}
	
	public void draw (GL10 gl) {
		pen.applayToScene(gl);
		gl.glVertexPointer(3, GL10.GL_FLOAT, 0, pLine.getBuffer());
		gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, pLine.count());
	}

}
